<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
   'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
  <html xmlns='http://www.w3.org/1999/xhtml'>
    <head>
      <meta http-equiv='content-type' content='text/html; charset=utf-8' />
      <meta name='generator' content='CoverStory' />
      <link rel=StyleSheet href='coverstory.css' type='text/css'>
      <script src='coverstory.js' language='javascript' type='text/javascript'></script>
      <title>GridView.m</title>
    </head>
    <body id='coverstory' onload='coverstory_load()' onunload='coverstory_unload()'>
      <div id='maincontainer'>
        <h1 id='sourcename'>GridView.m</h1>
        <h2 id='sourcepath'>/Users/ankitthakur/Documents/Sample/XCode Tools/ATNetworks/Classes/Views/GridView/GridView.m</h2>
        <div id='sourcedate'>15/06/10 6:47 PM</div>
        <div id='filelistcontainer'>
          <div id='filesummary'>35.8% of 1100 lines</div>
          <table id='filetable'>
            <tr id='filelistheader'>
              <th id='filelistheadersource'>Source</th>
              <th id='filelistheaderpercent'>%</th>
            </tr>
            <tr class='fileline'>
<td class='filename'><a href='ATImageDownloader.m.html'>ATImageDownloader.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATImageOperation.m.html'>ATImageOperation.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='GridView.m.html'>GridView.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='IconView.m.html'>IconView.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='NSObject+SBJSON.m.html'>NSObject+SBJSON.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='NSString+SBJSON.m.html'>NSString+SBJSON.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='Reachability.m.html'>Reachability.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='TableViewCell.m.html'>TableViewCell.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='SBJsonWriter.m.html'>SBJsonWriter.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>2.63</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='Music.m.html'>Music.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>7.69</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='SBJSON.m.html'>SBJSON.m</a></td>
<td class='filepercent'><span class='filelessthan35percent'>30.16</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATJSONDispatcher.m.html'>ATJSONDispatcher.m</a></td>
<td class='filepercent'><span class='filelessthan45percent'>35.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='SBJsonParser.m.html'>SBJsonParser.m</a></td>
<td class='filepercent'><span class='filelessthan55percent'>46.36</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATNetworksAppDelegate.m.html'>ATNetworksAppDelegate.m</a></td>
<td class='filepercent'><span class='filelessthan55percent'>50.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='SBJsonBase.m.html'>SBJsonBase.m</a></td>
<td class='filepercent'><span class='filelessthan65percent'>60.87</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATNetwork.m.html'>ATNetwork.m</a></td>
<td class='filepercent'><span class='filelessthan75percent'>69.89</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='main.m.html'>main.m</a></td>
<td class='filepercent'><span class='filelessthan75percent'>71.43</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATIconDownloader.m.html'>ATIconDownloader.m</a></td>
<td class='filepercent'><span class='filelessthan75percent'>72.34</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='TableViewController.m.html'>TableViewController.m</a></td>
<td class='filepercent'><span class='filegoodcoveragepercent'>79.71</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATNetworksViewController.m.html'>ATNetworksViewController.m</a></td>
<td class='filepercent'><span class='filegoodcoveragepercent'>89.36</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATConnection.m.html'>ATConnection.m</a></td>
<td class='filepercent'><span class='filegoodcoveragepercent'>100.00</span></td>
</tr>

          </table>
        </div>
        <div id='sourcecontainer'>
          <div id='sourcesummary'>Executed 0.0% of 106 lines (0 executed, 106 executable, 241 total lines)</div>
          <table id='sourcetable'>
          <tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>//</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>//  GridView.m</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>//  ATNetworks</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>//</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>//  Created by Ankit Thakur on 18/04/10.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>//  Copyright 2010 __MyCompanyName__. All rights reserved.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>//</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>#import &quot;GridView.h&quot;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>#import &quot;IconView.h&quot;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>#import &quot;ATImageDownloader.h&quot;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>@implementation GridView</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>@synthesize imageUrlArray;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>@synthesize imageArray;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>@synthesize imageDownloader;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>@synthesize labelArray;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>@synthesize delegate;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>- (id)initWithFrame:(CGRect)frame {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    if (self = [super initWithFrame:frame]) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        // Initialization code</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    imageUrlArray = [[NSMutableArray arrayWithObjects:</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>              @&quot;http://t1.gstatic.com/images?q=tbn:JJcFsrX-VhLDyM:http://www.anvari.org/db/cols/Persian_Models/Persian_Models_VS.jpg&quot;,</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>              </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>              @&quot;http://t2.gstatic.com/images?q=tbn:YWNavZYMmY41XM:http://earth2tech.files.wordpress.com/2009/06/tesla-models.jpg&quot;,</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>              </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>              @&quot;http://www.yosax.com/wp-content/uploads/proton-in-india.jpg&quot;,</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>              </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>              @&quot;http://www.dieselstation.com/pics/Spyker%20C12%20Zagato-car-wallpaper.jpg&quot;,</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>              </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>              @&quot;http://cdn-www.rsportscars.com/images/ferrari/2006-ferrari-f430-challenge/f430ch06_011600_w800.jpg&quot;,</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>              </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>              @&quot;http://www.jackzap.com/wp-content/uploads/2009/07/ferrari_california-8891.jpg&quot;,</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>              </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>              @&quot;http://www.dieselstation.com/wallpapers/thumbnails/Spyker/C12-Zagato/SMALL_Spyker%20C12%20Zagato-widescreen-04.jpg&quot;,</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>              </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>              @&quot;http://www.dieselstation.com/wallpapers/thumbnails/Spyker/C12-Zagato/SMALL_Spyker%20C12%20Zagato-widescreen-05.jpg&quot;,nil] retain];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    return self;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>- (void)drawRect:(CGRect)rect {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // Drawing code</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  [self performSelectorInBackground:@selector(loadIconImage) withObject:nil];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  [self performSelector:@selector(createIconView)];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>- (NSInteger) numberOfIcons{</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  return [imageUrlArray count];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>-(void) createIconView{</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  CGRect rect = self.bounds;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  UIView *_headerView = [[UIView alloc] initWithFrame:CGRectMake(rect.origin.x, </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                                   rect.origin.y, </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                                   rect.size.width, </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                                   200)];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  int index = 1;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  for (int row = 0; row &lt;ICON_ROWS; row++) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    for (int col=0; col &lt; ICON_COLUMNS; col++) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      CGRect rect = CGRectMake(ICON_MARGIN*col+ICON_WIDTH*col-ICON_WIDTH*1, ICON_MARGIN*row + ICON_HEIGHT*row-ICON_HEIGHT*1, ICON_WIDTH, ICON_HEIGHT);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>      CGRect frame = CGRectMake(SIDE_MARGIN + col * (ICON_MARGIN + ICON_WIDTH),</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                                      ICON_MARGIN + row * (ICON_MARGIN + ICON_HEIGHT),</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                                      ICON_WIDTH, </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                    ICON_HEIGHT);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>      </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            CGRect labelFrame = CGRectMake(SIDE_MARGIN + col * (ICON_MARGIN + ICON_WIDTH),</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                       ICON_MARGIN + row * (ICON_MARGIN + ICON_HEIGHT)+ICON_HEIGHT,</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                       ICON_LABEL_WIDTH, </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                       ICON_MARGIN);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>      </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            IconView *icon = [[[IconView alloc] initWithFrame:frame] autorelease];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      [icon setTag:index];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      [icon addTarget:delegate action:@selector(fobAction:) forControlEvents:UIControlEventTouchUpInside];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      NSLog(@&quot;%@&quot;, icon);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      [_headerView addSubview:icon];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>      </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        // Setting the fob name</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      if(index-1 &lt; [labelArray count]){</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        UILabel *label = [[[UILabel alloc] initWithFrame:labelFrame] autorelease];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        [label setText:[labelArray objectAtIndex:index-1]];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        label.numberOfLines = 2;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        label.font = kFontNormal;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        label.textAlignment = UITextAlignmentCenter;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        label.backgroundColor = kColorClear;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        label.adjustsFontSizeToFitWidth = YES;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        [_headerView addSubview:label];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>      }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>      </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>      </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      index++;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>      </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      _headerView.frame = CGRectMake(rect.origin.x, </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                       rect.origin.y, </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                       rect.size.width, </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                       ICON_MARGIN + row * (ICON_MARGIN + ICON_HEIGHT)+ ICON_HEIGHT);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>      </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  for (int col=0; col &lt; LAST_ROW_ICONS; col++) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    int row = ICON_ROWS;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    CGRect rect = CGRectMake(ICON_MARGIN*col+ICON_WIDTH*col-ICON_WIDTH*1, ICON_MARGIN*row + ICON_HEIGHT*row-ICON_HEIGHT*1, ICON_WIDTH, ICON_HEIGHT);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    CGRect frame = CGRectMake(SIDE_MARGIN + col * (ICON_MARGIN + ICON_WIDTH),</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                  ICON_MARGIN + row * (ICON_MARGIN + ICON_HEIGHT),</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                  ICON_WIDTH, </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                  ICON_HEIGHT);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    CGRect labelFrame = CGRectMake(SIDE_MARGIN + col * (ICON_MARGIN + ICON_WIDTH),</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                     ICON_MARGIN + row * (ICON_MARGIN + ICON_HEIGHT)+ICON_MARGIN,</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                     ICON_WIDTH, </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                     ICON_MARGIN);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    IconView *icon = [[[IconView alloc] initWithFrame:frame] autorelease];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    [icon setTag:index];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    [icon addTarget:delegate action:@selector(fobAction:) forControlEvents:UIControlEventTouchUpInside];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    [_headerView addSubview:icon];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>      // Setting the fob name</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    if(index-1 &lt; [labelArray count]){</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      UILabel *label = [[[UILabel alloc] initWithFrame:labelFrame] autorelease];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      label.font = kFontNormal;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      label.textAlignment = UITextAlignmentCenter;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      label.backgroundColor = kColorClear;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      label.adjustsFontSizeToFitWidth = YES;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>      </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>      </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      [label setText:[labelArray objectAtIndex:index-1]];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      label.numberOfLines = 2;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      [_headerView addSubview:label];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    index++;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    _headerView.frame = CGRectMake(rect.origin.x, </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                     rect.origin.y, </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                     rect.size.width, </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                     ICON_MARGIN + row * (ICON_MARGIN + ICON_HEIGHT)+ ICON_HEIGHT);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(rect.origin.x, </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                                        rect.origin.y, </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                                        rect.size.width, </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>                                        rect.size.height)];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  scrollView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  _headerView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  scrollView.contentSize = CGSizeMake(_headerView.bounds.size.width, _headerView.bounds.size.height+300) ;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  CGRect rect1 = _headerView.frame;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  _headerView.frame = CGRectMake(0, 0, 320, rect1.size.height);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  scrollView.bounces = YES;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  scrollView.bouncesZoom = YES;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  scrollView.scrollEnabled = YES;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  scrollView.minimumZoomScale = 0.5;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  scrollView.maximumZoomScale = 5.0;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  scrollView.delegate = nil;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  scrollView.tag = SCROLLVIEW_TAG;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  [scrollView addSubview: _headerView];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  [self addSubview:scrollView];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  [scrollView release];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  scrollView = nil;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  [_headerView release];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  _headerView = nil;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>-(void) loadIconImage{</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  NSAutoreleasePool *subPool = [[NSAutoreleasePool alloc] init];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  @try {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    if (imageDownloader==nil)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      imageDownloader = [[ATImageDownloader alloc] init];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    for (int i = 1; i &lt; [imageUrlArray count]+1; i++) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>      </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      NSString *imageUrlString = [imageUrlArray objectAtIndex:i-1];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      NSURL *url = [[NSURL alloc] initWithString:imageUrlString];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      NSString *tag = [NSString stringWithFormat:@&quot;%d&quot;,i];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:url,@&quot;url&quot;,tag,@&quot;tag&quot;,nil];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      [imageDownloader loadImageFromURL:dict withCallbackTarget:self withCallbackSelector:@selector(callBack:)];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      tag = nil;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      dict = nil;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      [url release];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>      url = nil;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  @catch (NSException * e) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    logger(@&quot;loadIconImage ---&gt; %@&quot;,[e description]);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  [subPool release];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (void) callBack: (NSMutableDictionary*)dict_</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>{</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  int tag_ = [[dict_ objectForKey:@&quot;tag&quot;] intValue];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  [(IconView*)[[[self viewWithTag:SCROLLVIEW_TAG] viewWithTag:tag_] viewWithTag:222] removeFromSuperview];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  [(IconView*)[[self viewWithTag:SCROLLVIEW_TAG] viewWithTag:tag_] setBackgroundImage:[dict_ objectForKey:@&quot;imageData&quot;] forState:UIControlStateNormal];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  dict_ = nil;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>- (void)dealloc {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  [imageUrlArray release];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  imageUrlArray = nil;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  if (imageDownloader != nil)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    [imageDownloader release];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>  imageDownloader = nil;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    [super dealloc];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>@end/*EOF*/</td>
</tr>

          </table>
        </div>
      </div>
    </body>
  </html>